package main

import "fmt"

func main() {
	sum := 0
	for i := 1; i <= 10; i++ {
		sum += i
	}
	fmt.Println(sum)
	//fmt.Println(i)

	i := 0
	for ; i < 10; i++ {
		fmt.Println("boby")

	}

	j := 0
	for j < 10 {
		fmt.Println("boby")
		j++

	}

	//死循环
	//for {
	//	fmt.Println("jj")
	//}
	name := "hcj:洪聪锦"
	for _, value := range name {
		fmt.Printf("%c\n", value)
	}
	//1.name是一个字符串,2.字符串是字符的数组
	fmt.Printf("%c\n", name[0])
	fmt.Printf("%c\n", name[6])
	name_arr := []rune(name)
	for i := 0; i < len(name_arr); i++ {
		fmt.Printf("%c\n", name_arr[i])
	}
}
